Add LP/v1 logprobs trace payload deserialization (FIR-21499)#452
Merged
Conversation
…21499). Decode logprobs payloads into completion_logprobs and Message.logprobs on EvaluationRow. Pop base_url from completion_params before OpenAI SDK calls so dev inference API can be encoded in gateway tracing URLs. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac3db7b2b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cing. Co-authored-by: Cursor <cursoragent@cursor.com>
colin-fireworks
approved these changes
May 28, 2026
xiaoyifan
approved these changes
May 28, 2026
Use get() in build_init_request so base_url remains available for gateway URL encoding, and filter it out in remote_server when calling the SDK. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e901c69. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
lp_deserializer(LP/v1) and wire intofireworks_tracingforpayloads.logprobs.execution_metadata.extra.completion_logprobsand last-assistantMessage.logprobs["content"](cookbook path).base_urlfrom completion params intracing_utilsso it is encoded into gateway URLs only (fixes dev API routing).Test plan
pytest tests/adapters/test_lp_deserializer.py tests/adapters/test_fireworks_tracing_logprobs.py -qDepends on gateway publishing
logprobspayloads (fw-ai/fireworks).Made with Cursor
Note
Medium Risk
Changes trace-to-row shape and remote completion kwargs; logprobs only appear once the gateway publishes payloads, but bad LP data is isolated via warnings.
Overview
Adds LP/v1 support so Fireworks traces that include
payloads.logprobscan be turned into eval rows with per-token completion logprobs, mirroring the existing R3 router-replay path.A new
lp_deserializerdecodes base64 + zstd LP01 blobs into logprob scalars and optional token IDs (token IDs are dropped when any wire id is missing).convert_trace_dict_to_evaluation_rowuses that data to fillexecution_metadata.extra(completion_logprobs, optionalcompletion_token_ids,logprobs_metadata) and attachesMessage.logprobs["content"]on the last assistant message. Failures are logged and do not fail the whole conversion.The test remote server no longer forwards
base_urlinsidecompletion_paramsto the OpenAI client—routing stays onmodel_base_url/ gateway URL encoding—aligning with howbuild_init_requesttreatsbase_urlfor tracing URLs (comment-only tweak intracing_utils).Reviewed by Cursor Bugbot for commit e901c69. Bugbot is set up for automated code reviews on this repo. Configure here.